import request from '@/utils/request'
//登录
export function login(data) {
  return request({
    url: '/login',
    method: 'post',
    data
  })
}
//获取用户信息
export function getInfo(token) {
  return request({
    url: '/admin/info',
    method: 'get',
    params: { token }
  })
}
//退出
export function logout() {
  return request({
    url: '/logout',
    method: 'post'
  })
}
//分页查询
export function pageUserList(query){
  return request({
    url: '/admin/list',
    method: 'get',
    params: query
  })
}
//新增
export function saveAdmin(data){
  return request({
      url:"/admin/saveAdmin",
      method:"post",
      data
  });
}
//编辑
export function findByAdminId(adminId){
  return request({
    url:"/admin/getById/"+adminId,
    method:"get"
  })
}
//修改
export function updateAdmin(data){
  return request({
    url:"/admin/updateAdmin",
    method:"post",
    data
  })
}
//删除
export function delAdmin(id){
  return request({
    url:"/admin/delAdmin/"+id,
    method:"get"
  });
}